{extend name="../../admin/view/public/admin"}

{block name='style'}

{/block}

{block name='content'}

<div class="page-header">当前位置：
    <span class="text-primary">数据维护</span>
    <span>共 <strong>{$total}</strong> 张表</span>
    <span>/</span>
    <span> <strong>{$totalSize}</strong> Mb</span>
</div>

<div class="page-content">

    <form action="" method="get" class="form-horizontal table-search" role="form">
        <div class="page-toolbar">
            <div class="col-sm-8 pull-left">
                <button class="btn btn-info btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:webUrl('ops/doBack',array('type' => 'table','value'=>0))}"><i class="icon icon-file-o"></i> 备份数据</button>
                <button class="btn btn-info btn-sm btn-operation" type="button" onclick="ajaxModel(this)" data-url="{:webUrl('ops/imports',array('type' => 'table','value'=>0))}"><i class="icon icon-repeat"></i> 恢复数据</button>
                <button class="btn btn-info btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:webUrl('ops/optimizeTable',array('type' => 'table','value'=>0))}"><i class="icon icon-gear"></i> 修复表</button>
                <button class="btn btn-info btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:webUrl('ops/repairTable',array('type' => 'table','value'=>0))}"><i class="icon icon-star-o"></i> 优化表</button>
            </div>
            <div class="col-md-4 pull-right" style="text-align: right;">
                <div class="row" style="line-height: 30px;">
                    <span>共 <strong>{$total}</strong> 张表</span>
                    <span>/</span>
                    <span> <strong>{$totalSize}</strong> Mb</span>
                </div>
            </div>
        </div>
    </form>

    {if empty($list)}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {else}
    <form action="" method="post">
        <table class="table table-responsive table-hover">
            <thead class="navbar-inner">
            <tr>
                <th style="width:40px;"><input type='checkbox'/></th>
                <th style='width:120px'>表名</th>
                <th style='width:100px'>备注</th>
                <th style='width:60px'>类型</th>
                <th style='width:60px'>数据(Mb)</th>
                <th style='width:60px'>索引(Mb)</th>
                <th style='width:60px'>合计(Mb)</th>
                <th style='width:60px'>记录数</th>
                <th style='width:60px'>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $list as $key=>$row }
            <tr>
                <td>
                    <input type='checkbox' value="{$row['Name']},{$row['Data_length']}"/>
                </td>
                <td>{$row['Name']}</td>
                <td>{$row['Comment']}</td>
                <td>{$row['Engine']}</td>
                <td>{$row['Data_length']}</td>
                <td>{$row['Index_length']}</td>
                <td>{$row['Data_total']}</td>
                <td>{$row['Rows']}</td>
                <td>
                    <a data-url="{:webUrl('ops/dictionary', array('table' => $row['Name']))}" onclick="ajaxModel(this)" class="btn btn-op btn-operation">
                        <span data-toggle="tooltip" data-placement="top" data-original-title="查看">
                            <i class='icon icon-eye'></i> 查看字典
                        </span>
                    </a>
                </td>
            </tr>
            {/foreach}
            </tbody>
            <tfoot>
            <tr>
                <td><input type="checkbox"></td>
                <td colspan="8">

                </td>
            </tr>
            </tfoot>
        </table>
    </form>
    {/if}

</div>

{/block}

{block name='script'}
<script>

</script>
{/block}